package com.my.study.common.security;

import com.my.study.dto.JwtUserDto;
import org.springframework.security.authentication.AbstractAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;

import java.util.Collection;

/**
 * 抽象自定义身份验证令牌
 * 
 * @author yidujun
 * @date 2022/8/4 11:20
 */
public abstract class AbstractCustomAuthenticationToken extends AbstractAuthenticationToken {
    private static final long serialVersionUID = 7726496611155555220L;
    
    protected JwtUserDto jwtUserDto;

    /**
     * Creates a token with the supplied array of authorities.
     *
     * @param authorities the collection of <tt>GrantedAuthority</tt>s for the principal
     *                    represented by this authentication object.
     */
    public AbstractCustomAuthenticationToken(Collection<? extends GrantedAuthority> authorities) {
        super(authorities);
    }
    
    public JwtUserDto getJwtUserDto() {
        return jwtUserDto;
    }

    public void setJwtUserDto(JwtUserDto jwtUserDto) {
        this.jwtUserDto = jwtUserDto;
    }
}
